#include "BitReader.h"

#include <iostream>

BitReader::BitReader(long value, int currentPos) : bits(value){
        this->currentPos = currentPos;
        while(this->bits.to_string()[this->currentPos] == '0')
                this->currentPos++;
}

BitReader::BitReader(char* value, int currentPos) : bits(std::string(value).substr(currentPos)){
        this->currentPos = 0;
}

bool BitReader::getBit(){
        return (this->bits.to_string()[this->currentPos++] == '1');
}

long BitReader::getValue(){
        return this->bits.to_ulong();
}

BitReader::~BitReader() {

}
